package com.example.practice.ui;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.os.CountDownTimer;

import com.alibaba.android.arouter.launcher.ARouter;
import com.example.common.ARouterPath;
import com.example.practice.BuildConfig;
import com.example.practice.databinding.ActivitySplashBinding;

public class SplashActivity extends AppCompatActivity {
    private ActivitySplashBinding binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding=ActivitySplashBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

    }

    @Override
    protected void onResume() {
        super.onResume();
        binding.version.setText(String.format("当前版本号%s", BuildConfig.VERSION_NAME));
        CountDownTimer count=new CountDownTimer(5000,1000) {
            @Override
            public void onTick(long l) {
            binding.countTime.setText(String.format("倒计时：%s",l/1000));
            }

            @Override
            public void onFinish() {
                ARouter.getInstance().build(ARouterPath.SP_JUMP_USER).navigation();
            }
        }.start();
    }
}